package fr.cdj.thebox.client.events;

import com.google.gwt.event.shared.GwtEvent;

public class SearchFilesRequestEvent extends GwtEvent<SearchFilesRequestHandler> {

	private static Type<SearchFilesRequestHandler> type;

	private String search;

	public SearchFilesRequestEvent(String search) {
		this.search = search;
	}

	public static Type<SearchFilesRequestHandler> getType() {
		if (type == null) {
			type = new Type<SearchFilesRequestHandler>();
		}
		return type;
	}

	@Override
	public Type<SearchFilesRequestHandler> getAssociatedType() {
		return getType();
	}

	@Override
	protected void dispatch(SearchFilesRequestHandler handler) {
		handler.onSearchFilesRequest(this);
	}

	public String getSearch() {
		return search;
	}
	
}
